<%@ page language="java" pageEncoding="utf-8"%>
<%@ include file="/common/include.jsp"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
	<jsp:include page="../../../common/head.jsp">
		 <jsp:param name="_spPage" value="true"/>
	</jsp:include>
	<title>角色管理</title>
	<script language="JavaScript">   
		//添加角色
		function insOperationRole()
		{
			window.parent.frame_right.location.href="${ctx}/jsp/system/operationRole/add_operationRole.jsp";
	
		}
		//修改角色
		function updateOperationRole()
		{
			if(xjCommon.varClkTr==null)
				alert("请选择要修改的角色信息");
			else
			{
				if($(xjCommon.varClkTr).attr("edit")!="false")
					window.parent.frame_right.location.href="updateOperationRole.do?roleId="+$(xjCommon.varClkTr).attr("id");
				else
					alert("所选角色为系统内定，不能修改！");
			}
		}
		//删除角色
		function delOperationRole()
		{
			if(xjCommon.varClkTr==null)
				alert("请选择要修改的角色信息");
			else
			{
				if($(xjCommon.varClkTr).attr("delete")!="false")
				{
					if(confirm("确定要删除该角色吗？"))
					{
							var a=ModalWindow("jump.do?path=delOperationRole.do&roleId="+$(xjCommon.varClkTr).attr("id"),640,480);
							if(a=="ok")
							{
								parent.frame_right.location.href="${ctx}/blank_common.jsp?title=角色管理";
								xjSpPage.spPageSubmit();
							}
						}
					}
				else
					alert("所选角色为系统内定，不能删除！");
			}
		}
		xjCommon.trClickUserFunc = function()
		{
			var roleId = $(xjCommon.varClkTr).attr("id");
			window.parent.frame_right.location.href="listUserOperationRole.do?roleId="+roleId;
		}
</script>
	</head>
	<body>
		<form action='listOperationRole.do' name="form1"  method="post">
	<div id="body_div">
	<w:ShowTitle name="角色管理">
	<w:TitleButton funcName="添加" onClickFunction="insOperationRole()" urlImg="${ctx}/images/main/add.png"/>
	<w:TitleButton funcName="修改" onClickFunction="updateOperationRole()" urlImg="${ctx}/images/main/update.png"/>
	<w:TitleButton funcName="删除" onClickFunction="delOperationRole()" urlImg="${ctx}/images/main/delete.png"/>
	</w:ShowTitle>
	<div id="body_content">
				<table width="100%" cellspacing="0" class="XJContexTable">
				  <tr >
				    <td class="td_title" width="150">角色名称</td>
				    <td class="td_title" width="80">角色类型</td>
				    <td class="td_title" width="80">角色代码</td>
				    <td class="td_title" >角色标识</td>
				    </tr>
				    <c:choose>
					<c:when test="${fn:length(datalist)>0 }">
				    <c:forEach items="${datalist}" var="obj" >
				        <tr onclick="xjCommon.TrClick(this)" id="${obj.roleId}" <c:if test="${obj.state eq 'S'}">edit="false" delete="false"</c:if>>
					        <td>${obj.roleName }</td>
					        <td>
					        ${obj.roleType}
					        </td>
					        <td>${obj.roleCode }</td>
					        <td>${obj.roleSign}</td>
				        </tr>
				    </c:forEach>
				    </c:when>
			   		<c:otherwise>
			               	<tr><td colspan="3">暂无符合条件的数据！</td></tr>
              		</c:otherwise>
               </c:choose>
				</table>
				<w:spPage style="mini"/>
			</div>
			</div>
		
		</form>
	</body>
</html>
